<?php

class ConsoleCommand extends CConsoleCommand {

    public $serverPath;
    public $theme;

    public function init() {
        
    }

    public function actionIndex() {
        
    }

    public function currentTime() {
        
    }

    public function onBeforeAction($event) {
        parent::onBeforeAction($event);
    }

    public function onAfterAction($event) {
        parent::onAfterAction($event);
    }

    public function urlText($text) {
        return $text;
    }

    protected function xmlData($tag, $content = null, $tagOption = array()) {
        if (is_string($content)) {
            $content = trim($content);
            if (!empty($content) && !in_array($content, array('-'))) {
                $content = '<![CDATA[' . $content . ']]>';
                //$content = CHtml::cdata($content);
            }//end if
        }//end if

        return $content === null || $content == '' ? '' : CHtml::openTag($tag, $tagOption) . $content . CHtml::closeTag($tag);
    }

    public function message($name, $message) {
        echo "[" . date('d-m-Y h:i:s', time()) . "] " . $name . ': ' . $message . "\n";
    }

}